package H;

/**
 * 测试
 */
public class Test1 {
    public void attack(Attack attack){
        attack.attack();
    }
    public void defend(Defend defend){
        defend.defend();
    }
    public void treat(Treat treat){
        treat.treat();
    }
    public void hunt(Hunt hunt){
        hunt.hunt();
    }
    public void mine(Mine mine){
        mine.mine();
    }
    public void rob(Rob rob){
        rob.rob();
    }
    public static void main(String[] args) {
        Test1 test = new Test1();
        test.rob(new Robber("黄鼠",21));
        test.attack(new Robber());
        test.hunt(new Hunter("后裔",23));
        test.attack(new Hunter());
        test.mine(new Farmer("蛮牛",18));
        test.attack(new Farmer());
        test.treat(new Farmer());
        test.treat(new Doctor("扁鹊",20));
        test.defend(new Soldier("战刚",37));
    }
}

